<?php
/** An interface to the Hosting Reborn API notification functions.
 * @package com\hostingreborn\api
 * @link https//api.hostingreborn.com/docs/functions/notification/
 *
 * @author      Jon Cram <jon@hostingreborn.com>
 * @copyright   https://api.hostingreborn.com/code/copyright/
 * @license     https://api.hostingreborn.com/code/license/
 * @version     1.0
 *
 * $Date$
 * $Revision$
 *
 *
 */

require_once('HR_api.class.php');

class HR_notificationApi extends HR_api {
    
    /***************************************************************************/
    /* Attributes                                                              */
    /***************************************************************************/

    /***************************************************************************/
    /* Constructors                                                            */
    /***************************************************************************/

    /***************************************************************************/
    /* Public methods                                                          */
    /***************************************************************************/

    
    /**
     * @link http://api.hostingreborn.com/docs/functions/notification/verify/
     *
     * @param string $type
     * @param string $notificationKey
     * @param string $recipient
     * @param string $datetime
     * @return bool 
     */
    public function verify($type = null, $notificationKey = null, $recipient = null, $datetime = null) {
        /*
            Exceptions thrown by API:
                - database (handled internally by API)
                - system (handled internally by API)
        */

        $queryString = http_build_query(array(
		'type' => $type,
		'notification_key' => $notificationKey,
		'recipient' => $recipient,
		'datetime' => $datetime
        ));
        
        return $this->read('notification/verify/?'.$queryString)->wasSuccessful();
    }

    /***************************************************************************/
    /* Private methods                                                         */
    /***************************************************************************/

}

?>